package com.order.orderback.controller;
import com.order.orderback.service.StoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/api")
public class StoreController {

    @Autowired
    private StoreService storeService;

    @GetMapping("/stores")
    public List<Map<String, Object>> getShops(@RequestParam Map<String, Object> params) {
        return storeService.getShops(params);
    }

    @GetMapping("/shop/{id}")
    public Map<String, Object> getShopDetail(@PathVariable Integer id) {
        return storeService.getShopDetail(id);
    }

    @GetMapping("/swiper")
    public List<Map<String, Object>> getSwiperImages() {
        return storeService.getSwiperImages();
    }
}
